package com.oneday;

import java.util.Scanner;

public class Demo8 {
    public static void main(String[] args) {
         int age1=14;
         int age2=13;

         char sex='d';
         /*关系运算符*/
        // age1>age2
        System.out.println(age1>age2);
        System.out.println(age1<age2);
        System.out.println(age1==age2);
        System.out.println(age1!=age2);
        /*逻辑运算符*/
        System.out.println((age1>age2 && sex=='男'));
        System.out.println((age1>age2 || sex=='男'));
        System.out.println(!(age1>age2 || sex=='男'));
        /*条件运算符*/
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入年龄：");
        int age = scanner.nextInt();
        String num=age > 18 ? "我成年了" : "我没有成年了";
        System.out.println(num);

    }
}
